import { Drawer, Descriptions, Spin, Collapse } from 'antd';
import { MyAssetListManageAPI } from '../common/type';
import ScrollBarLayout from '@/components/ScrollBarLayout';
import React, { useEffect } from 'react';
import MyIcon from '@/components/MyIcon';
import { removeDateHmsStr } from '@/utils';
/**
 * 详情
 * @param onClose  关闭方法
 * @param isShowDetail  isShow
 * @param recordObj  点击对象
 */
const UserInfoDrawer: React.FC<MyAssetListManageAPI.DetailsDrawerAPI> = ({ onClose, isShowDetail, recordObj, curRes, reloadManage }) => {
  /**样式*/
  const prefixCls = 'material-updata-';

  /**抽屉详情的关闭方法**/
  const oneDetailClose = () => {
    onClose();
  };

  useEffect(() => {}, [isShowDetail]);

  return (
    <>
      <Drawer
        className={prefixCls + 'MaterialDetailDrawer'}
        title="更多信息"
        style={{ position: 'absolute', height: '100%', overflow: 'hidden' }}
        placement="right"
        onClose={oneDetailClose}
        open={isShowDetail}
        getContainer={false}
        width={document.body?.clientWidth * 0.45}
        headerStyle={{ padding: '1rem' }}
        bodyStyle={{ padding: 0 }}
        closable={false}
        destroyOnClose={true}
      >
        <div
          id="oneDetailDrawerBox"
          className={prefixCls + 'allDetailDrawerBox'}
          style={{
            display: 'flex',
            flexDirection: 'column',
            overflow: 'hidden',
          }}
        >
          <ScrollBarLayout style={{ padding: '5px 0px', flex: 'auto' }}>
            <Spin spinning={false}>
              {/* 资管员信息 */}
              <div style={{ margin: 10 }}>
                <Descriptions bordered={true} size="small" column={1} labelStyle={{ width: 200 }}>
                  <Descriptions.Item
                    label={
                      <>
                        <MyIcon type={'icon-zhiji'} />
                        &nbsp; 资管员
                      </>
                    }
                  >
                    <div>{recordObj?.asseterName || '--'}</div>
                  </Descriptions.Item>

                  {/* <Descriptions.Item
                    label={
                      <>
                        <MyIcon type={'icon-zhiwei'} />
                        &nbsp; 资管员岗位
                      </>
                    }
                  >
                    <div>{recordObj?.assetPositionName || '--'}</div>
                  </Descriptions.Item> */}

                  <Descriptions.Item
                    label={
                      <>
                        <MyIcon type={'icon-bumen'} />
                        &nbsp; 资管员部门
                      </>
                    }
                  >
                    <div>{recordObj?.assetDepartmentName || '--'}</div>
                  </Descriptions.Item>

                  <Descriptions.Item
                    label={
                      <>
                        <MyIcon type={'icon-gongsi'} />
                        &nbsp; 资管员单位
                      </>
                    }
                  >
                    <div>{recordObj?.assetCompanyName || '--'}</div>
                  </Descriptions.Item>

                  <Descriptions.Item
                    label={
                      <>
                        <MyIcon type={'icon-time'} />
                        &nbsp; 资管时间
                      </>
                    }
                  >
                    <div>{removeDateHmsStr(recordObj?.assetTime) || '--'}</div>
                  </Descriptions.Item>
                </Descriptions>
              </div>
            </Spin>
          </ScrollBarLayout>
        </div>
      </Drawer>
    </>
  );
};
export default UserInfoDrawer;

// {/* 仓库信息 */ }
{
  /* <div style={{ margin: '5px 10px 10px 10px' }}> */
}
{
  /* <Descriptions bordered={true} size="small" column={1} labelStyle={{ width: 200 }}> */
}
{
  /* <Descriptions.Item
                    label={
                      <>
                        <MyIcon type={'icon-barcode'} />
                        &nbsp; 仓库编码
                      </>
                    }
                  >
                    <div>{recordObj?.massetStore?.storeCode || '--'}</div>
                  </Descriptions.Item> */
}

{
  /* <Descriptions.Item
      label={
        <>
          <MyIcon type={'icon-cangku'} />
          &nbsp; 仓库名称
        </>
      }
    >
      <div>{recordObj?.massetStore?.storeName || '--'}</div>
    </Descriptions.Item>

    <Descriptions.Item
      label={
        <>
          <MyIcon type={'icon-weizhi'} />
          &nbsp; 仓库位置
        </>
      }
    >
      <div>{recordObj?.massetStore?.storePlace || '--'}</div>
    </Descriptions.Item>

    <Descriptions.Item
      label={
        <>
          <MyIcon type={'icon-zuzhijigou'} />
          &nbsp; 仓库所属单位
        </>
      }
    >
      <div>{recordObj?.massetStore?.storeCompanyName || '--'}</div>
    </Descriptions.Item>

    <Descriptions.Item
      label={
        <>
          <MyIcon type={'icon-zhuangtai'} />
          &nbsp; 状态
        </>
      }
    >
      <div>
        {recordObj?.massetStore?.storeState === 1
          ? '开启'
          : recordObj.massetStore?.storeState === 2
            ? '关闭'
            : recordObj.massetStore?.storeState === 3
              ? '作废'
              : '--'}
      </div>
    </Descriptions.Item>

    <Descriptions.Item
      label={
        <>
          <MyIcon type={'icon-bussinessman'} />
          &nbsp; 仓库管理员
        </>
      }
    >
      {recordObj?.massetStore?.storeUserName || '--'}
    </Descriptions.Item>
    <Descriptions.Item
      label={
        <>
          <MyIcon type={'icon-phone'} />
          &nbsp; 联系方式
        </>
      }
    >
      {recordObj?.massetStore?.storeDutyPhone || '--'}
    </Descriptions.Item>
  </Descriptions>
</div> */
}
